package com.ry.bhwktapp.home.ui

import android.content.Intent
import android.view.View
import androidx.collection.arrayMapOf
import com.bbq.base.base.BaseVMFragment
import com.ry.bhwktapp.R
import com.ry.bhwktapp.databinding.FragmentHomeBinding
import com.ry.bhwktapp.ui.AboutActivity
import com.ry.bhwktapp.utils.TTSUtils
import com.ry.bhwktapp.utils.TTsUtil

class HomeFragment : BaseVMFragment<FragmentHomeBinding>() {
    private val TAG = "HomeFragment"

    fun throwExFun(param: String?) {
        if (param == null) {
            throw NullPointerException()
        }
    }

    override fun onResume() {
        println()
        throwExFun("jsjs")
        super.onResume()
    }

    override fun onDestroy() {
        super.onDestroy()
    }

    override fun onPause() {
        super.onPause()
    }

    override fun getLayoutId(): Int {
        return R.layout.fragment_home
    }

    override fun initData() {
        super.initData()
    }

    override fun initView(view: View) {
        mBinding.btnAbout.setOnClickListener(View.OnClickListener {
//            TTsUtil.getInstance().speak("你好小泥鳅");
            TTSUtils.getInstance(getContext()).playText("抓小泥鳅好费劲！");
            val intent = Intent()
            intent.setClass(this.requireContext(), AboutActivity::class.java)
            startActivity(intent)
        })

        var name:String ="45"
        val toInt = name.toInt()
        val toFloat = name.toFloat()
        val toDouble = name.toDouble()
        val toLong = name.toLong()
        val toBigDecimal = name.toBigDecimal()
        val toBoolean = name.toBoolean()

        val arrayListOf = arrayListOf<String>()
    }
}